﻿


function PauseUser(status, id) {
    if (status == null || status == "") {
        alert("请选择要变更的状态!");
        return;
    }
    if (id == null) {
        var list = new Array();
        $("INPUT[name='cb'][type='checkbox'][checked]").each(function() {
            list.push($(this).val());
        });
        if (list.length >= 1) {
            $.post("/admin/PauseUser.aspx", { "id": list, "status": status }, function(data) { alert(data); window.location.href = window.location.href; });
        }
        else {
            alert("请选择!");
        }
    }
    else {
        $.post("/admin/PauseUser.aspx", { "id": id, "status": status }, function(data) { alert(data); window.location.href = window.location.href; });
    }
}
function ChangeSenior(status, id) {
    if (status == null ) {
        alert("请选择要变更的状态!");
        return;
    }
    if (id == null) {
        var list = new Array();
        $("INPUT[name='cb'][type='checkbox'][checked]").each(function() {
            list.push($(this).val());
        });
        if (list.length >= 1) {
            $.post("/admin/ChangeSenior.aspx", { "id": list, "status": status }, function(data) { alert(data); window.location.href = window.location.href; });
        }
        else {
            alert("请选择!");
        }
    }
    else {
        $.post("/admin/ChangeSenior.aspx", { "id": id, "status": status }, function(data) { alert(data); window.location.href = window.location.href; });
    }
}

function ChangePostStatus(status) {
    if (status == null || status == "") {
        alert("请选择要变更的状态!");
        return;
    }
    var list = new Array();
    $("INPUT[name='cb'][type='checkbox'][checked]").each(function() {
        list.push($(this).val());
    });
    if (list.length >= 1) {
        $.post("/admin/ChangePostStatus.aspx", { "id": list, "status": status }, function(data) { alert(data); window.location.href = window.location.href; });
    }
    else {
        alert("请选择!");
    }
}

function DelUser(id) {
    if (confirm("确定要删除吗?")) {
        if (id == null) {
            var list = new Array();
            $("INPUT[name='cb'][type='checkbox'][checked]").each(function() {
                list.push($(this).val());
            });
            if (list.length >= 1) {
                $.post("/admin/DelUser.aspx", { "id": list }, function(data) { alert(data); window.location.href = window.location.href; });
            }
            else {
                alert("请选择!");
            }
        }
        else {
            $.post("/admin/DelUser.aspx", { "id": id }, function(data) { alert(data); window.location.href = window.location.href; });
        }
    }
}

function delPersonResume() {
    if (confirm("确定要删除吗?")) {
        var list = new Array();
        $("INPUT[name='cb'][type='checkbox'][checked]").each(function() {
            list.push($(this).val());
        });
        if (list.length >= 1) {
            $.post("/company/DelPersonResume.aspx", { "id": list }, function(data) { alert(data); window.location.href = window.location.href });
        }
        else {
            alert("请选择人员!");
        }
    }
}


function AdminApplyPersonFavorite(id) {
    if (id == null) {
        var list = new Array();
        $("INPUT[name='cb'][type='checkbox'][checked]").each(function() {
            list.push($(this).val());
        });
        if (list.length >= 1) {
            $.getJSON("/admin/ApplyPersonFavorite.aspx", { "fid": list }, function(data) { if (data[0] == "1") { alert(data[1]); window.location.href = window.location.href; } else { alert(data[1]); } });
        }
        else {
            alert("请选择一个!");
        }
    }
    else {
        $.getJSON("/admin/ApplyPersonFavorite.aspx", { "fid": id }, function(data) { if (data[0] == "1") { alert(data[1]); window.location.href = window.location.href; } else { alert(data[1]); } });
    }
}


function delOpinion(id) {
    if (confirm("确定要删除吗?")) {
        if (id == null) {
            var list = new Array();
            $("INPUT[name='cb'][type='checkbox'][checked]").each(function() {
                list.push($(this).val());
            });
            if (list.length >= 1) {
                $.post("/admin/delopinion.aspx", { "id": list }, function(data) { alert(data); window.location.href = window.location.href });
            }
            else {
                alert("请选择一个!");
            }
        }
        else {
            $.post("/admin/delopinion.aspx", { "id": id }, function(data) { alert(data); window.location.href = window.location.href });
        }
    }
}

function delMessage(id) {
    if (confirm("确定要删除吗?")) {
        if (id == null) {
            var list = new Array();
            $("INPUT[name='cb'][type='checkbox'][checked]").each(function() {
                list.push($(this).val());
            });
            if (list.length >= 1) {
                $.post("/message/delmessage.aspx", { "id": list }, function(data) { alert(data); window.location.href = window.location.href });
            }
            else {
                alert("请选择一个!");
            }
        }
        else {
            $.post("/message/delmessage.aspx", { "id": id }, function(data) { alert(data); window.location.href = window.location.href });
        }
    }
}